home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / gnu / bash / bash_108 / bash-108.zoo / bash-1.08 / cpp-Makefile < prev    next >
Encoding:
Makefile  |  1991-08-22  |  20.0 KB  |  659 lines

  1. /* This -*- C -*- file (cpp-Makefile) is run through the C preprocessor
  2.    to produce bash-Makefile which is machine specific.
  3.  
  4.    If you have Gcc and/or Bison, you might wish to mention that right
  5.    below here.
  6.  
  7.    Since this is to become a Makefile, blank lines which appear outside
  8.    of comments may not contain a TAB character.
  9.  
  10.    Copyright (C) 1987,1991 Free Software Foundation, Inc.
  11.  
  12.    This file is part of GNU Bash, the Bourne Again SHell.
  13.  
  14.    Bash is free software; you can redistribute it and/or modify it under
  15.    the terms of the GNU General Public License as published by the Free
  16.    Software Foundation; either version 1, or (at your option) any later
  17.    version.
  18.  
  19.    Bash is distributed in the hope that it will be useful, but WITHOUT ANY
  20.    WARRANTY; without even the implied warranty of MERCHANTABILITY or
  21.    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  22.    for more details.
  23.  
  24.    You should have received a copy of the GNU General Public License along
  25.    with Bash; see the file COPYING.  If not, write to the Free Software
  26.    Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
  27. */
  28.  
  29. /**/# This Makefile is automagically made from cpp-Makefile.  You should
  30. /**/# not be editing this file; edit cpp-Makefile, machines.h, or
  31. /**/# makeargs.sh instead.  Then, assuming the edits were required to
  32. /**/# compile Bash on your system, mail the changes you had to make to
  33. /**/# bash-maintainers@ai.mit.edu.  We will do our best to incorporate
  34. /**/# them into the next release.
  35.  
  36. /* **************************************************************** */
  37. /*                                    */
  38. /*            Which compiler are you using?            */
  39. /*                                    */
  40. /* **************************************************************** */
  41.  
  42. /* Define HAVE_GCC if you have the GNU C compiler. */
  43. /* #define HAVE_GCC */
  44.  
  45. /* Define HAVE_FIXED_INCLUDES if you are using GCC with the fixed
  46.    header files. */
  47. #if defined (HAVE_GCC) && !defined (HAVE_FIXED_INCLUDES)
  48. /* #define HAVE_FIXED_INCLUDES */
  49. #endif /* HAVE_GCC && !HAVE_FIXED_INCLUDES */
  50.  
  51. /* Define HAVE_BISON if you have the GNU replacement for Yacc. */
  52. /**/# We would like you to use Bison instead of Yacc since some
  53. /**/# versions of Yacc cannot handle reentrant parsing.  Unfortunately,
  54. /**/# this includes the Yacc currently being shipped with SunOS4.x.
  55. /**/# If you do use Yacc, please make sure that any bugs in parsing
  56. /**/# are not really manifestations of Yacc bugs before you report
  57. /**/# them.
  58. #define HAVE_BISON
  59.  
  60. /**/# Can be overidden on invocation.
  61. MAKE = make
  62.  
  63. /* Where are you installing the shell? */
  64. #if defined (M_DESTDIR)
  65. DESTDIR = M_DESTDIR
  66. #else
  67. DESTDIR = /usr/gnu/bin
  68. #endif /* M_DESTDIR */
  69.  
  70. /* This includes the appropriate description for the machine that you are
  71.    using (we hope).  If the compilation doesn't work correctly, then you
  72.    will have to edit the file `machines.h' to include a description for the
  73.    machine that your Cpp uniquely identifies this as.  For example, Sun 4's
  74.    are recognized by the Cpp identifier `sparc', Vax is recognized with `vax',
  75.    etc.  The order of these files is very important.  Config.h must come last,
  76.    since it is capable of undef'ing various things. */
  77. #define BUILDING_MAKEFILE   /* Tell config.h to avoid #including anything. */
  78. #include "sysdefs.h"
  79. #include "machines.h"
  80. #include "config.h"
  81.  
  82. /**/# Here is a rule for making .o files from .c files that does not
  83. /**/# force the type of the machine (like -M_MACHINE) into the flags.
  84. .c.o:
  85.     $(RM) $@
  86.     $(CC) -c $(CFLAGS) $(CPPFLAGS) $*.c
  87.  
  88. #if defined (HAVE_BISON)
  89. BISON = bison -y
  90. #else
  91. BISON = yacc
  92. #endif
  93.  
  94. #if defined (HAVE_GCC)
  95. #if !defined (HAVE_FIXED_INCLUDES)
  96. /* This is guaranteed to work, even if you have the fixed includes!
  97.    (Unless, of course, you have the fixed include files installed in
  98.    /usr/include.  Then it will break. ) */
  99. CC = gcc -traditional -I/usr/include
  100. #else
  101. CC = gcc
  102. #endif /* !HAVE_FIXED_INCLUDES */
  103. #else
  104. CC = CPP_CC
  105. #endif /* HAVE_GCC */
  106.  
  107. /**/# Of course, you cannot do this the first time through...
  108. /**/#SHELL=/usr/gnu/bin/bash
  109. SHELL=/bin/sh
  110.  
  111. MACHINE = M_MACHINE
  112. OS = M_OS
  113.  
  114. /**/# PROFILE_FLAGS is either -pg, to generate profiling info for use
  115. /**/# with gprof, or nothing (the default).
  116. PROFILE_FLAGS=
  117.  
  118. #if defined (HAVE_SHARED_LIBS) && defined (sun)
  119. #  if !defined (HAVE_GCC)
  120. /**/# On Sun systems, we compile without shared libraries so we
  121. /**/# can debug the shell with gdb.
  122. NOSHARE = -Bstatic
  123. #  endif
  124. #endif
  125.  
  126. #if defined (SYSDEP_CFLAGS)
  127. /**/# This system has some peculiar flags that must be passed to the
  128. /**/# the C compiler (or to cpp).
  129. SYSDEP = SYSDEP_CFLAGS
  130. #endif /* SYSDEP_CFLAGS */
  131.  
  132. #if defined (SYSDEP_LDFLAGS)
  133. /**/# This system has some peculiar flags that must be passed to the
  134. /**/# the loader.
  135. SYSDEP_LD = SYSDEP_LDFLAGS
  136. #endif /* SYSDEP_LDFLAGS */
  137.  
  138. #if defined (HAVE_SETLINEBUF)
  139. /**/# This system has the setlinebuf () call.
  140. LINEBUF = -DHAVE_SETLINEBUF
  141. #endif
  142.  
  143. #if defined (HAVE_VPRINTF)
  144. /**/# This system has the vprintf () and vfprintf calls.
  145. VPRINTF = -DHAVE_VPRINTF
  146. #endif /* HAVE_VPRINTF */
  147.  
  148. #if defined (HAVE_UNISTD_H)
  149. /**/# This system has <unistd.h>.
  150. UNISTD = -DHAVE_UNISTD_H
  151. #endif
  152.  
  153. #if defined (HAVE_MULTIPLE_GROUPS)
  154. /**/# This system has multiple groups.
  155. GROUPS = -DHAVE_MULTIPLE_GROUPS
  156. #endif
  157.  
  158. #if defined (HAVE_RESOURCE)
  159. /**/# This system has <sys/resource.h>
  160. RESOURCE = -DHAVE_RESOURCE
  161. #endif
  162.  
  163. #if defined (VOID_SIGHANDLER)
  164. /**/# This system's signal () call returns a pointer to a function returning
  165. /**/# void.  The signal handlers themselves are thus void functions.
  166. SIGHANDLER = -DVOID_SIGHANDLER
  167. #endif
  168.  
  169. #if defined (HAVE_STRERROR)
  170. /**/# This system has the strerror () function.
  171. STRERROR = -DHAVE_STRERROR
  172. #endif
  173.  
  174. #if defined (HAVE_WAIT_H)
  175. /**/# This system has <sys/wait.h>
  176. WAITH = -DHAVE_WAIT_H
  177. #endif
  178.  
  179. #if defined (HAVE_GETWD)
  180. /**/# This system has the getwd () call.
  181. GETWD = -DHAVE_GETWD
  182. #endif
  183.  
  184. #if defined (HAVE_DUP2)
  185. /**/# This system has a working version of dup2 ().
  186. DUP2 = -DHAVE_DUP2
  187. #endif /* HAVE_DUP2 */
  188.  
  189. SYSTEM_FLAGS = $(LINEBUF) $(VPRINTF) $(UNISTD) $(GROUPS) $(RESOURCE) \
  190.        $(SIGHANDLER) $(SYSDEP) $(WAITH) $(GETWD) $(DUP2) -D$(MACHINE) -D$(OS)
  191. DEBUG_FLAGS = $(PROFILE_FLAGS) -g
  192. LDFLAGS    = $(SYSDEP_LD) $(DEBUG_FLAGS)
  193. CFLAGS    = $(DEBUG_FLAGS) $(SYSTEM_FLAGS) -DSHELL $(ALLOCA_CFLAGS)
  194. CPPFLAGS= -I$(LIBSRC)
  195.  
  196. /**/# These are required for sending bug reports.
  197. SYSTEM_NAME = $(MACHINE)
  198. OS_NAME = $(OS)
  199.  
  200. /**/# The name of this program.
  201. PROGRAM = bash
  202.  
  203. /**/# The type of machine Bash is being compiled on.
  204. HOSTTYPE_DECL = -DHOSTTYPE='$(SYSTEM_NAME)'
  205.  
  206. /**/# The default primary and secondary prompts.
  207. PPROMPT = '"${PROGRAM}\\$$ "'
  208. SPROMPT = '"> "'
  209.  
  210. #if defined (MAINTAINER)
  211. bash_maintainer = MAINTAINER
  212. MAINTAIN_DEFINE = -DMAINTAINER='"$(bash_maintainer)"'
  213. #endif
  214.  
  215. /**/# The group of configuration flags.  These are for shell.c
  216. CFG_FLAGS = -DPPROMPT=$(PPROMPT) -DSPROMPT=$(SPROMPT) -DOS_NAME='"$(OS_NAME)"'\
  217.         -DSYSTEM_NAME='$(SYSTEM_NAME)' $(SIGLIST_FLAG) $(MAINTAIN_DEFINE)
  218.  
  219. /**/# The directory which contains the source for malloc.  The name must
  220. /**/# end in a slash, as in "./alloc-files/".
  221. ALLOC_DIR = ./alloc-files/
  222.  
  223. /**/# Our malloc.
  224. #if defined (USE_GNU_MALLOC)
  225. MALLOC = $(ALLOC_DIR)malloc.o
  226. MALLOC_FLAGS = -Drcheck -Dbotch=programming_error
  227. #endif /* USE_GNU_MALLOC */
  228.  
  229. #if !defined (HAVE_ALLOCA)
  230. ALLOCA = $(ALLOC_DIR)alloca.o
  231.  
  232. #if defined (ALLOCA_ASM)
  233. ALLOCA_SOURCE = $(ALLOC_DIR)ALLOCA_ASM
  234. #else
  235. ALLOCA_SOURCE = $(ALLOC_DIR)alloca.c
  236. #endif /* ALLOCA_ASM */
  237.  
  238. #endif /* !HAVE_ALLOCA */
  239.  
  240. /* Compilation flags to use in the shell directory and to pass to builds
  241.    in subdirectories (readline, termcap) to ensure that alloca is treated
  242.    in a consistent fashion. */
  243. #if defined (HAVE_ALLOCA_H)
  244. ALLOCA_H_DEFINE = -DHAVE_ALLOCA_H
  245. #else
  246. ALLOCA_H_DEFINE =
  247. #endif /* HAVE_ALLOCA_H */
  248.  
  249. #if defined (HAVE_ALLOCA)
  250. ALLOCA_DEFINE = -DHAVE_ALLOCA
  251. #else
  252. ALLOCA_DEFINE =
  253. #endif /* HAVE_ALLOCA */
  254.  
  255. ALLOCA_CFLAGS = $(ALLOCA_DEFINE) $(ALLOCA_H_DEFINE)
  256.  
  257. ALLOC_HEADERS = $(ALLOC_DIR)getpagesize.h
  258. ALLOC_FILES = $(ALLOC_DIR)malloc.c $(ALLOC_DIR)alloca.c \
  259.           $(ALLOC_DIR)i386-alloca.s $(ALLOC_DIR)x386-alloca.s
  260.  
  261. #if !defined (HAVE_SIGLIST)
  262. /**/# If your system does not have sys_siglist, then define SIGLIST
  263. /**/# as siglist.o
  264. SIGLIST = siglist.o
  265. SIGLIST_FLAG=-DINITIALIZE_SIGLIST
  266. #endif /* HAVE_SIGLIST */
  267.  
  268. RM = rm -f
  269. AR = ar
  270.  
  271. /**/# The location of ranlib on your system.
  272. #if defined (RANLIB_LOCATION)
  273. RANLIB = RANLIB_LOCATION
  274. #else
  275. RANLIB = ranlib
  276. #endif /* RANLIB_LOCATION */
  277.  
  278. /**/# Support libraries required.  Termcap and Readline.
  279. /**/# The location of sources for the support libraries.
  280. LIBSRC = ./
  281. RLIBSRC = $(LIBSRC)readline/
  282.  
  283. RLIBDOC = $(RLIBSRC)doc/
  284.  
  285. /**/# Source, object and docuemntation of the history library.
  286. HISTORY_SOURCE    = $(RLIBSRC)history.c $(RLIBSRC)history.h
  287. HISTORY_OBJ    = $(RLIBSRC)history.o
  288. HISTORY_DOC    = $(RLIBDOC)hist.texinfo $(RLIBDOC)hsuser.texinfo \
  289.           $(RLIBDOC)hstech.texinfo
  290.  
  291. /**/# The source, object and documentation for the GNU Readline library.
  292. READLINE_SOURCE    = $(RLIBSRC)readline.c $(RLIBSRC)readline.h\
  293.           $(RLIBSRC)chardefs.h $(RLIBSRC)keymaps.h\
  294.           $(RLIBSRC)funmap.c $(RLIBSRC)emacs_keymap.c\
  295.           $(RLIBSRC)vi_keymap.c $(RLIBSRC)keymaps.c\
  296.           $(RLIBSRC)vi_mode.c $(HISTORY_SOURCE)
  297.  
  298. READLINE_OBJ    = $(RLIBSRC)readline.o $(RLIBSRC)funmap.o \
  299.           $(RLIBSRC)keymaps.o $(HISTORY_OBJ)
  300.  
  301. READLINE_DOC    = $(RLIBDOC)rlman.texinfo $(RLIBDOC)rluser.texinfo \
  302.           $(RLIBDOC)rltech.texinfo
  303.  
  304. READLINE_DOC_SUPPORT  = $(RLIBDOC)Makefile $(RLIBDOC)texinfo.tex \
  305.           $(RLIBDOC)readline.dvi $(RLIBDOC)readline.info \
  306.           $(RLIBDOC)history.dvi $(RLIBDOC)history.info
  307.  
  308. /**/# This has to be written funny to avoid looking like a C comment starter.
  309. READLINE_EXAMPLES = $(RLIBSRC)examples/[a-zA-Z]*.c $(RLIBSRC)examples/Makefile
  310.  
  311. /**/# Support files for GNU Readline.
  312. READLINE_SUPPORT = $(RLIBSRC)Makefile $(RLIBSRC)ChangeLog $(RLIBSRC)COPYING \
  313.            $(READLINE_EXAMPLES) $(READLINE_DOC_SUPPORT)
  314.  
  315. #if defined (HAVE_READLINE_SOURCE)
  316. #define READLINE_LIBRARY ./readline/libreadline.a
  317. #else
  318. #define READLINE_LIBRARY -lreadline
  319. #endif
  320.  
  321. #if defined (USE_GNU_TERMCAP)
  322. #define HAVE_TERMCAP_SOURCE
  323. /**/# The source, object and documentation for the GNU Termcap library.
  324. TLIBSRC = $(LIBSRC)termcap/
  325. TLIBDOC = $(TLIBSRC)termcap.texinfo
  326. #define TERMCAP_LIBRARY ./termcap/libtermcap.a
  327.  
  328. TERMCAP_SOURCE    = $(TLIBSRC)termcap.c $(TLIBSRC)tparam.c
  329. TERMCAP_OBJ    = $(TLIBSRC)libtermcap.a
  330. TERMCAP_DOC    = $(TLIBSRC)termcap.texinfo
  331. TERMCAP_SUPPORT = $(TLIBSRC)Makefile $(TLIBSRC)ChangeLog
  332. TERMCAP_LDFLAGS = -L$(TLIBSRC)
  333. #endif /* USE_GNU_TERMCAP */
  334.  
  335. LIBRARY_SOURCE    = $(READLINE_SOURCE) $(TERMCAP_SOURCE)
  336. LIBRARY_DOC    = $(READLINE_DOC) $(HISTORY_DOC) $(TERMCAP_DOC)
  337. LIBRARY_SUPPORT    = $(READLINE_SUPPORT) $(TERMCAP_SUPPORT)
  338. LIBRARY_TAR    = $(LIBRARY_SOURCE) $(LIBRARY_DOC) $(LIBRARY_SUPPORT)
  339.  
  340. #if defined (READLINE)
  341. /**/# You wish to compile with the line editing features installed.
  342. READLINE_LIB = -lreadline
  343.  
  344. /* You only need termcap for readline. */
  345. #if defined (USE_TERMCAP_EMULATION)
  346. TERMCAP_LIB = -lcurses
  347. #else
  348. TERMCAP_LIB = -ltermcap
  349. #endif /* USE_TERMCAP_EMULATION */
  350.  
  351. /**/# Directory list for -L so that the loader can find -lreadline.
  352. #if defined (HAVE_READLINE_SOURCE)
  353. READLINE_LDFLAGS = -L$(RLIBSRC) $(TERMCAP_LDFLAGS)
  354. #else
  355. READLINE_LDFLAGS = -L/usr/gnu/lib -L/usr/local/lib $(TERMCAP_LDFLAGS)
  356. #endif /* HAVE_READLINE_SOURCE */
  357.  
  358. /**/# The source and object of the bash->readline interface code.
  359. RL_SUPPORT_SRC = bashline.c
  360. RL_SUPPORT_OBJ = bashline.o
  361. #endif /* READLINE */
  362.  
  363. #if defined (REQUIRED_LIBRARIES)
  364. /**/# Locally required libraries.
  365. LOCAL_LIBS = REQUIRED_LIBRARIES
  366. #endif /* REQUIRED_LIBRARIES */
  367.  
  368. /**/# The order is important.  Most dependent first.
  369. LIBRARIES = $(READLINE_LIB) $(TERMCAP_LIB) $(LOCAL_LIBS)
  370.  
  371. #if defined (HAVE_TERMCAP_SOURCE)
  372. TERMCAP_DEP = TERMCAP_LIBRARY
  373. #endif
  374.  
  375. #if defined (HAVE_READLINE_SOURCE)
  376. READLINE_DEP = READLINE_LIBRARY
  377. #endif
  378.  
  379. /**/# Source files for libraries that Bash depends on.
  380. LIBDEP = $(READLINE_DEP) $(TERMCAP_DEP)
  381.  
  382. /**/# Rules for cleaning the readline and termcap sources.
  383. #if defined (HAVE_READLINE_SOURCE)
  384. #define CLEAN_READLINE (cd $(RLIBSRC); $(MAKE) clean)
  385. #else
  386. #define CLEAN_READLINE :
  387. #endif
  388. #if defined (HAVE_TERMCAP_SOURCE)
  389. #define CLEAN_TERMCAP (cd $(TLIBSRC); $(MAKE) clean)
  390. #else
  391. #define CLEAN_TERMCAP :
  392. #endif
  393.  
  394. CSOURCES = shell.c parse.y general.c make_cmd.c print_cmd.c y.tab.c \
  395.        dispose_cmd.c execute_cmd.c variables.c builtins.c\
  396.        fc.c expr.c copy_cmd.c flags.c subst.c glob.c hash.c mailcheck.c\
  397.        test.c trap.c jobs.c nojobs.c $(ALLOC_FILES) braces.c\
  398.        unwind_prot.c siglist.c ulimit.c version.c $(RL_SUPPORT_SRC)
  399.  
  400. HSOURCES = shell.h flags.h trap.h hash.h jobs.h builtins.h alias.c y.tab.h \
  401.        alias.h general.h variables.h config.h $(ALLOC_HEADERS) \
  402.        quit.h ndir.h machines.h posixstat.h
  403.  
  404. SOURCES     = $(CSOURCES) $(HSOURCES)
  405.  
  406. OBJECTS     = shell.o y.tab.o general.o make_cmd.o print_cmd.o\
  407.        dispose_cmd.o execute_cmd.o variables.o builtins.o copy_cmd.o\
  408.        fc.o expr.o flags.o jobs.o subst.o glob.o hash.o mailcheck.o test.o\
  409.        trap.o alias.o $(MALLOC) $(ALLOCA) braces.o unwind_prot.o\
  410.        $(SIGLIST) ulimit.o version.o $(RL_SUPPORT_OBJ)
  411.  
  412. /**/# Documentation for the shell.
  413. DOCDIR = ./documentation/
  414. BASH_TEXINFO = $(DOCDIR)*.texi $(DOCDIR)*.tex \
  415.             $(DOCDIR)*.dvi $(DOCDIR)Makefile # $(DOCDIR)*.texinfo
  416. BASH_MAN = $(DOCDIR)bash.1
  417. BASHDOCS = $(BASH_TEXINFO) $(BASH_MAN) INSTALL README
  418. DOCUMENTATION = $(BASHDOCS) $(LIBRARY_DOC)
  419.  
  420. /**/# Some example files
  421. /* This has to be written funny to avoid looking like a comment starter. */
  422. EXAMPLES = examples/[a-zA-Z]*
  423.  
  424. ENDIAN_SUPPORT = endian.c
  425. PIPESIZE_SUPPORT = psize.c psize.sh
  426. SCRIPTS_SUPPORT = makeargs.sh cppmagic.sh cat-s make-tarfile mail-shell inform
  427.  
  428. CREATED_SUPPORT = endian.aux endian.h pipesize.h psize.aux sysdefs.h
  429.  
  430. SUPPORT = $(ENDIAN_SUPPORT) $(PIPESIZE_SUPPORT) $(SCRIPTS_SUPPORT) \
  431.       COPYING Makefile cpp-Makefile ChangeLog .distribution \
  432.       $(EXAMPLES) newversion.c
  433.  
  434. /**/# BAGGAGE consists of things that you want to keep with the shell for some
  435. /**/# reason, but do not actually use; old source code, etc.
  436. BAGGAGE = longest_sig.c
  437.  
  438. /**/# Things that the world at large needs.
  439. THINGS_TO_TAR = $(SOURCES) $(LIBRARY_TAR) $(BASHDOCS) $(SUPPORT) $(BAGGAGE)
  440.  
  441. /**/# Things that maintainers need, but no one else.
  442. MAINTAINENCE = shell-mail bash-distribution-list
  443.  
  444. all: .made
  445.  
  446. .made: $(PROGRAM)
  447.     cp .machine .made
  448.  
  449. $(PROGRAM):  .build $(OBJECTS) $(LIBDEP) .distribution
  450.     rm -f $@
  451.     $(CC) $(LDFLAGS) $(READLINE_LDFLAGS) -o $(PROGRAM) $(OBJECTS) $(LIBRARIES)
  452.  
  453. .build:    $(SOURCES) cpp-Makefile newversion.aux
  454.     if ./newversion.aux -build; then mv -f newversion.h version.h; fi
  455.     @echo
  456.     @echo "      ***************************************************"
  457.     @echo "      *                            *"
  458.     @echo "      * Making Bash for a $(MACHINE) running $(OS)."
  459.     @echo "      *                            *"
  460.     @echo "      ***************************************************"
  461.     @echo
  462.     @echo "$(PROGRAM) last made for a $(MACHINE) running $(OS)" >.machine
  463.  
  464. version.h:    newversion.aux
  465.     if ./newversion.aux -build; then mv -f newversion.h version.h; fi
  466.  
  467. shell.h:    general.h variables.h config.h quit.h
  468.         touch shell.h
  469.  
  470. jobs.h:        endian.h quit.h
  471.         touch jobs.h
  472.  
  473. variables.h:    hash.h
  474.         touch variables.h
  475.  
  476. /* If we are compiling with ALIAS defined, then this dependency makes sense. */
  477. #if defined (ALIAS)
  478. builtins.h:    alias.h
  479.         touch builtins.h
  480. #endif /* ALIAS */
  481.  
  482. y.tab.c:    parse.y shell.h
  483.         -if test -f y.tab.h; then mv -f y.tab.h old-y.tab.h; fi
  484.         $(BISON) -d parse.y
  485.         -if cmp -s old-y.tab.h y.tab.h; then mv old-y.tab.h y.tab.h; fi
  486.  
  487. #if defined (HAVE_READLINE_SOURCE)
  488. READLINE_LIBRARY: $(READLINE_SOURCE)
  489.     (cd $(RLIBSRC); $(MAKE) $(MFLAGS) CC='$(CC)' CFLAGS='$(CFLAGS)' RANLIB=$(RANLIB))
  490. #endif /* HAVE_READLINE_SOURCE */
  491.  
  492. #if defined (HAVE_TERMCAP_SOURCE)
  493. TERMCAP_LIBRARY: $(TERMCAP_SOURCE)
  494.     (cd $(TLIBSRC); $(MAKE) $(MFLAGS) CC='$(CC)' CFLAGS='$(CFLAGS) -I.' RANLIB=$(RANLIB))
  495. #endif /* USE_GNU_TERMCAP */
  496.  
  497. version.o:    version.h
  498.  
  499. shell.o:    shell.h flags.h shell.c posixstat.h
  500.         $(CC) $(CFG_FLAGS) $(CFLAGS) $(CPPFLAGS) -c shell.c
  501.  
  502. ulimit.o:    shell.h ulimit.c pipesize.h
  503.         $(CC) $(CFLAGS) -c ulimit.c
  504.  
  505. pipesize.h:    psize.aux
  506.     sh psize.sh > pipesize.h
  507.  
  508. psize.aux:    psize.c
  509.     $(CC) $(CFLAGS) -o $@ psize.c
  510.  
  511. endian.h:    endian.aux
  512.     ./endian.aux endian.h
  513.  
  514. endian.aux:    endian.c
  515.     $(CC) $(CFLAGS) -o $@ endian.c
  516.  
  517. #if defined (USE_GNU_MALLOC)
  518. #if !defined (__GNUC__)
  519. $(MALLOC):    $(ALLOC_FILES)
  520.         $(CC) -I$(ALLOC_DIR) $(CFLAGS) $(MALLOC_FLAGS) -c $*.c
  521.         @-mv `basename $*`.o $(MALLOC) 2>/dev/null
  522. #else
  523. $(MALLOC):    $(ALLOC_FILES)
  524.         $(CC) -I$(ALLOC_DIR) $(CFLAGS) $(MALLOC_FLAGS) -c $*.c
  525. #endif
  526. #endif /* USE_GNU_MALLOC */
  527.  
  528. #if !defined (HAVE_ALLOCA)
  529. $(ALLOCA):    $(ALLOCA_SOURCE)
  530.         $(CC) -I$(ALLOC_DIR) $(CFLAGS) -c $(ALLOCA_SOURCE)
  531.         @-mv `basename $*`.o $(ALLOCA) >/dev/null 2>&1
  532. #endif /* !HAVE_ALLOCA */
  533.  
  534. variables.o: shell.h hash.h flags.h
  535.     $(CC) -c $(CFLAGS) $(HOSTTYPE_DECL) variables.c
  536.  
  537. /* Dependencies for the main bash source. */
  538. braces.o: general.h
  539. builtins.o: shell.h hash.h jobs.h builtins.h trap.h flags.h
  540. copy_cmd.o: shell.h hash.h
  541. dispose_cmd.o: shell.h
  542. execute_cmd.o: shell.h y.tab.h posixstat.h builtins.h flags.h jobs.h
  543. expr.o: shell.h hash.h
  544. fc.o: shell.h hash.h builtins.h
  545. flags.o: flags.h config.h general.h quit.h
  546. general.o: shell.h
  547. glob.o: config.h
  548. hash.o: shell.h hash.h
  549. jobs.o: shell.h hash.h trap.h jobs.h
  550. mailcheck.o: posixstat.h variables.h hash.h quit.h
  551. make_cmd.o: shell.h flags.h
  552. parse.o: shell.h flags.h
  553. print_cmd.o: shell.h y.tab.h
  554. shell.o: shell.h flags.h
  555. subst.o: shell.h flags.h alias.h jobs.h
  556. test.o: posixstat.h
  557. trap.o: trap.h shell.h hash.h
  558. ulimit.o: variables.h quit.h pipesize.h
  559. unwind_prot.o: config.h general.h
  560.  
  561. #if defined (READLINE)
  562. bashline.o: shell.h hash.h builtins.h
  563. #endif
  564.  
  565. /* Dependencies which rely on the user using the source to READLINE. */
  566. #if defined (HAVE_READLINE_SOURCE)
  567. bashline.o: $(RLIBSRC)chardefs.h $(RLIBSRC)history.h $(RLIBSRC)readline.h
  568. bashline.o: $(RLIBSRC)keymaps.h $(RLIBSRC)history.h
  569. fc.o:     $(RLIBSRC)history.h
  570. parse.o: $(RLIBSRC)keymaps.h $(RLIBSRC)chardefs.h $(RLIBSRC)history.h
  571. parse.o: $(RLIBSRC)readline.h
  572. subst.o: $(RLIBSRC)history.h
  573. #endif /* HAVE_READLINE_SOURCE */
  574.  
  575. $(PROGRAM).tar: $(THINGS_TO_TAR) .distribution
  576.     ./make-tarfile $(PROGRAM) `cat .distribution` $(THINGS_TO_TAR)
  577.  
  578. $(PROGRAM).tar.Z:    $(PROGRAM).tar
  579.         compress -f $(PROGRAM).tar
  580.  
  581. clone:
  582.     mkdir clone; \
  583.     (cd clone; for i in $(THINGS_TO_TAR); \
  584.       do file=`basename $$i`; \
  585.        dir=`echo $$i | sed "s/$$file\$$//" | sed 's@\(.*\)/\$$@\1@'`; \
  586.        if [ "$$dir" = "" ]; then dir="."; fi; \
  587.        if [ "$$dir" != "." ]; then \
  588.           if [ ! -d "$$dir" ]; then mkdir "$$dir"; fi; \
  589.           if [ "$$file" = Makefile ]; \
  590.         then cp ../$$i $$i; \
  591.            else ln -s ../../$$i $$i; \
  592.           fi; \
  593.        else if [ "$$file" = Makefile ]; then cp ../$$i $$i; \
  594.          else ln -s ../$$i $$i; fi; \
  595.        fi; \
  596.       done)
  597.  
  598. install:    .made
  599.         if [ -f $(DESTDIR)/$(PROGRAM) ]; \
  600.         then mv $(DESTDIR)/$(PROGRAM) $(DESTDIR)/$(PROGRAM).old; \
  601.         fi
  602.         cp $(PROGRAM) $(DESTDIR)/$(PROGRAM)
  603.         rm -f installed-$(PROGRAM)
  604.         ln -s $(DESTDIR)/$(PROGRAM) installed-$(PROGRAM)
  605.  
  606. mailable:    distribution
  607.         /bin/rm -rf uuencoded
  608.         mkdir uuencoded
  609.         $(SHELL) -c 'f=$(PROGRAM)-`cat .distribution`.tar.Z;uuencode $$f $$f | split -800 - uuencoded/$$f.uu.'
  610.  
  611. .distribution:
  612.         ./newversion.aux -dist `$(PROGRAM) -c 'echo $$BASH_VERSION'`
  613.  
  614. distribution:    $(PROGRAM) $(PROGRAM).tar.Z .distribution
  615.         @echo cp $(PROGRAM).tar.Z $(PROGRAM)-`cat .distribution`.tar.Z
  616.         @cp $(PROGRAM).tar.Z $(PROGRAM)-`cat .distribution`.tar.Z
  617.  
  618. newversion.aux:    newversion.c
  619.         $(CC) $(DEBUG_FLAGS) -o newversion.aux newversion.c -lm
  620.  
  621. newversion:    newversion.aux
  622.         rm -f .build
  623.         ./newversion.aux -dist
  624.         mv -f newversion.h version.h
  625.         $(MAKE) $(MFLAGS)
  626.  
  627. documentation:  documentation-frob
  628.         (cd $(DOCDIR); make)
  629.  
  630. documentation-frob:
  631.  
  632. tags:        $(SOURCES) $(LIBRARY_SOURCE)
  633.         etags $(SOURCES) $(LIBRARY_SOURCE)
  634.  
  635. INDEX:        $(SOURCES) $(LIBRARY_SOURCE)
  636.         ctags -x $(SOURCES) $(LIBRARY_SOURCE)
  637.  
  638. clean:
  639.         $(RM) $(OBJECTS) $(PROGRAM) *.aux
  640.         $(RM) .build .made version.h
  641.         $(RM) $(CREATED_SUPPORT)
  642.         $(RM) bash-Makefile
  643.         (cd $(DOCDIR); make clean)
  644.         CLEAN_READLINE;CLEAN_TERMCAP
  645.  
  646. /**/# Here is a convenient rule when you arrive at a new site and wish to
  647. /**/# install bash on several different architectures.  It creates a new
  648. /**/# directory to hold the results of compilatation.  The directory is
  649. /**/# named MACHINE-OS.
  650. architecture: $(MACHINE)-$(OS)/$(PROGRAM)
  651.  
  652. $(MACHINE)-$(OS):
  653.     mkdir $(MACHINE)-$(OS)
  654.  
  655. $(MACHINE)-$(OS)/$(PROGRAM): $(MACHINE)-$(OS) $(PROGRAM)
  656.     mv $(PROGRAM) $(MACHINE)-$(OS)
  657.     mv sysdefs.h $(MACHINE)-$(OS)
  658.     make clean
  659.